import os

def find_project_root(marker_files=('.git', 'pyproject.toml', 'requirements.txt')):
    """根据标记文件查找项目根目录"""
    current_dir = os.path.dirname(os.path.abspath(__file__))
    while current_dir != os.path.dirname(current_dir):  # 直到根目录
        if any(os.path.exists(os.path.join(current_dir, marker)) for marker in marker_files):
            return current_dir
        current_dir = os.path.dirname(current_dir)
    return os.getcwd()  # 如果没找到，返回当前工作目录